﻿' Copyright (C) 2011  Jan-Willem de Bruyn
'
'    This program is free software: you can redistribute it and/or modify
'    it under the terms of the GNU General Public License as published by
'    the Free Software Foundation, either version 3 of the License, or
'    (at your option) any later version.
'
'    This program is distributed in the hope that it will be useful,
'    but WITHOUT ANY WARRANTY; without even the implied warranty of
'    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
'    GNU General Public License for more details.
'
'    You should have received a copy of the GNU General Public License
'    along with this program.  If not, see <http://www.gnu.org/licenses/>.

Public Class embedder
    Inherits System.Web.UI.Page

    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load

    End Sub

    Protected Sub Button1_Click(ByVal sender As Object, ByVal e As EventArgs) Handles Button1.Click
        Dim i1 As Integer
        Dim i2 As Integer
        Dim texttofind As String = ".flv"
        texttofind = texttofind.ToLower
        Dim temp As String = TextBox2.Text.ToLower
        i1 = temp.IndexOf(texttofind, 0, TextBox2.Text.Length)
        i2 = temp.IndexOf("http://", 0, TextBox2.Text.Length)
        TextBox2.Text = TextBox2.Text.Remove(0, i2)
        TextBox2.Text = TextBox2.Text.Remove(TextBox2.Text.LastIndexOf(texttofind) + texttofind.Length)
        TextBox2.Text = "<embed name='maxilamba' width='480' height='340' allowfullscreen='true' src='http://www.maxilamba.com/player.swf' flashvars='file=" & TextBox2.Text & "&image=http://www.maxilamba.com/embed.jpg' type='application/x-shockwave-flash' pluginspage='http://get.adobe.com/flashplayer/'></embed><noembed><div id='no_embed' style='width: 480px; text-align: center; font-family: arial; font-size: 13px; color: #ff0000;'><br><b>Embed capable browser is required to view this content!</b><br><br></div></noembed><div style='background-color: #abddf8; width: 480px; text-align: right; font-family: arial; font-size: 13px; color: #000000;'><a href='http://www.maxilamba.com/flash.html?video=" & TextBox2.Text & "' style='color: #066192;' target='_blank'>Options</a> | <a href='http://www.maxilamba.com' style='color: #066192;' target='_blank'>MAXILAMBA!</a></div>"
    End Sub
End Class